package com.share.holder;

public class ContextHolder {
    private static final ThreadLocal<Long> userIdHolder = new ThreadLocal<>();

    public static void clear() {
        userIdHolder.remove();
    }

    public static Long get() {
        return userIdHolder.get();
    }

    public static void set(Long userId) {
        userIdHolder.set(userId);
    }
}
